<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Zend_Mime_Magic</title>
			<link rel="stylesheet" href="styles/phpdoc.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> Zend_Mime_Magic</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This class is used to classify the given file using some magic bytes  characteristic to a particular file type. The classification information can  be a MIME type or just text describing the file.</p>
<p class="description"><p>This method is slower than determining the type by file suffix but on the  other hand reduces the risk of fail positives during the test.</p><p>The magic file consists of ASCII characters defining the magic numbers for  different file types. Each row has 4 to 5 columns, empty and commented lines  (those starting with a hash character) are ignored. Columns are described  below.</p><p><ul><li><strong>1</strong> -- byte number to begin checking from. '&gt;' indicates a dependency
    upon the previous non-'&gt;' line</li><li><strong>2</strong> -- type of data to match. Can be one of following
    - <em>byte</em> (single character)
    - <em>short</em> (machine-order 16-bit integer)
    - <em>long</em> (machine-order 32-bit integer)
    - <em>string</em> (arbitrary-length string)
    - <em>date</em> (long integer date (seconds since Unix epoch/1970))
    - <em>beshort</em> (big-endian 16-bit integer)
    - <em>belong</em> (big-endian 32-bit integer)
    - <em>bedate</em> (big-endian 32-bit integer date)
    - <em>leshort</em> (little-endian 16-bit integer)
    - <em>lelong</em> (little-endian 32-bit integer)
    - <em>ledate</em> (little-endian 32-bit integer date)</li><li><strong>3</strong> -- contents of data to match</li><li><strong>4</strong> -- file description/MIME type if matched</li><li><strong>5</strong> -- optional MIME encoding if matched and if above was a MIME type</li></ul></p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Sven Vollbehr &lt;<a href="mailto:sven@vollbehr.eu">sven@vollbehr.eu</a>&gt;</li>
				<li><span class="field">version:</span> $Id: Magic.php 177 2010-03-09 13:13:34Z svollbehr $</li>
				<li><span class="field">copyright:</span> Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)</li>
				<li><span class="field">license:</span> <a href="http://framework.zend.com/license/new-bsd">New BSD License</a></li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="Zend_Mime/_Mime---Magic.php.html">/Mime/Magic.php</a> (line <span class="field">64</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																								<div class="method-definition">
					<img src="images/Constructor.png" alt=" "/>
					<a href="#__construct" title="details" class="method-name">__construct</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span>)
																<span class="method-result">Zend_Mime_Magic</span>
									</div>
																<div class="method-definition">
					<img src="images/Method.png" alt=" "/>
					<a href="#getMimeType" title="details" class="method-name">getMimeType</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$default</span> = <span class="var-default">null</span>])
																<span class="method-result">string|false</span>
									</div>
																<div class="method-definition">
					<img src="images/Method.png" alt=" "/>
					<a href="#isMimeType" title="details" class="method-name">isMimeType</a>
											(<span class="var-type">string|Array</span>&nbsp;<span class="var-name">$filename</span>, <span class="var-type">string|Array</span>&nbsp;<span class="var-name">$mimeType</span>)
																<span class="method-result">boolean|Array</span>
									</div>
											</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
													<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">74</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Reads the magic information from given magic file.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_Mime_Magic</span>
		<span class="method-name">
			__construct
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$filename</span><span class="var-description">: The path to the magic file.</span>			</li>
				</ul>
		
			
	</div>
<a name="getMimeType" id="getMimeType"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="images/Method.png" />
		<span class="method-title">getMimeType</span> (line <span class="line-number">92</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the recognized MIME type/description of the given file. The type  is determined by the content using magic bytes characteristic for the  particular file type.</p>
<p class="description"><p>If the type could not be found, the function returns the default value,  or <var>null</var>.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string|false</span>
		<span class="method-name">
			getMimeType
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$default</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$filename</span><span class="var-description">: The file path whose type to determine.</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$default</span><span class="var-description">: The default value.</span>			</li>
				</ul>
		
			
	</div>
<a name="isMimeType" id="isMimeType"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="images/Method.png" />
		<span class="method-title">isMimeType</span> (line <span class="line-number">179</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the results of the mime type check either as a boolean or an  array of boolean values.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean|Array</span>
		<span class="method-name">
			isMimeType
		</span>
					(<span class="var-type">string|Array</span>&nbsp;<span class="var-name">$filename</span>, <span class="var-type">string|Array</span>&nbsp;<span class="var-name">$mimeType</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string|Array</span>
				<span class="var-name">$filename</span><span class="var-description">: The file path whose type to test.</span>			</li>
					<li>
				<span class="var-type">string|Array</span>
				<span class="var-name">$mimeType</span><span class="var-description">: The mime type to test against.</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Tue, 09 Mar 2010 16:51:25 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>